<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<jsp:include page="/WEB-INF/jsp/common/common.jsp" />
	<jsp:include page="/WEB-INF/jsp_lib/validate.jsp" />
	<script type="text/javascript">
		function query() {
			$("#form1").submit();
		}
		function destoryForm(mac_id) {
			$("input[name='mac_id']").val(mac_id);
	
			var url = "${path}/ix/mac/destory/destory_form.htm";
			$("#form1").attr("action", url);
			$("#form1").submit();
		}
		function selectAll() {
			var all = document.getElementById("choose");
			var allIds = document.getElementsByName("check_id");
			for (var i = 0; i < allIds.length; i++) {
				allIds[i].checked = all.checked;
			}
		}
		function destortVerify() {
			var check_ids = "";
			var $check_ids = $("input[name='check_id']:checked");
			$.each($check_ids, function(i, n) {
				check_ids += $(this).val() + ",";
			});
			if (check_ids.length > 0) {
				$("input[name='check_ids']").val(check_ids);
				var url = "${path}/ix/mac/destory/verify_all.htm";
				$("#form1").attr("action", url);
				$("#form1").submit();
			} else {
				ohSnap("请选择需报废的仪器！", "warning");
			}
		}
	</script>
</head>
<body>
	<div>
		<jsp:include page="/WEB-INF/jsp_lib/tip.jsp" />

		<form action="${path}/ix/mac/destory/list.htm" id="form1" method="post">
			<input type="hidden" name="mac_id" />
			<input type="hidden" name="check_ids" />
			<h2>
				<div>印控仪报废</div>
			</h2>
			<div class="query">
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="5">
					<tr>
						<td width="60" align="right">
							<strong>编号：</strong>
						</td>
						<td width="200" align="left">
							<input name="srh_name" value="${srh_name}" type="text" />
						</td>
						<td align="left">
							<a href="javascript:query();"> 
								<img src="${path}/style_cp/img/query.jpg" name="Image4" width="85" 
									height="27" border="0" id="Image4" />
							</a>
						</td>
					</tr>
				</table>
			</div>

			<table width="100%" class="listlindex">
				<tr>
					<th><input type="checkbox" id="choose" onclick="selectAll()" /></th>
					<th>设备编号</th>
					<th>设备mac地址</th>
					<th>持有机构</th>
					<th>设备状态</th>
					<th>操作</th>
				</tr>
				<c:if test="${fn:length(macList)==0}">
					<tr>
						<td colspan="6">
							<div class="tip_div">暂无记录.</div>
						</td>
					</tr>
				</c:if>
				<c:forEach items="${macList}" var="v">
					<tr>
						<td><input type="checkbox" name="check_id" value="${v._id}" /></td>
						<td>${v.code}</td>
						<td>${v.mac}</td>
						<td>${v.bname}[${v.bcode}]</td>
						<td>${v.flag}${v.flag_stop}</td>
						<td><a href="javascript:destoryForm('${v._id}');">【报废】</a></td>
					</tr>
				</c:forEach>
			</table>
			<div id="response"></div>
			<div class="options">
				<div class="quotes">
					<a href="javascript:destortVerify();" class="asave"
						style="float:left">【同意】</a>
					<page:page page="${page}" />
				</div>
				<div class="clear"></div>
			</div>
		</form>

	</div>
</body>
</html>